package com.hzzc.sso.sdk;

import com.hzzc.sso.sdk.session.SessionManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Administrator
 */
@Slf4j
@Configuration
@AutoConfigureAfter(SsoAppSdkConfig.class)
@EnableConfigurationProperties(value = SsoWebSdkProperties.class)
public class SsoWebSdkConfig {

    /**
     * 本地权限服务
     *
     * @return
     */
    @Bean
    public UserAuthorityService userAuthorityService() {
        return new UserAuthorityService();
    }


    @Bean
    public SsoWebFilter ssoWebFilter() {
        log.info("##实例化SsoWebFilter");
        return new SsoWebFilter();
    }

    @Bean
    public SsoCrosFilter ssoCrosFilter() {
        log.info("##实例化SsoCrosFilter");
        return new SsoCrosFilter();
    }

    @Bean
    public SessionManager sessionManager() {
        log.info("##实例化SessionManager");
        return new SessionManager();
    }
}
